#include "ThreadPool.hpp"
#include <ctime>
#include <stdlib.h>
#include <iostream>
using namespace std;


int main()
{
    ThreadPool<int>* pl = ThreadPool<int>::create();
    cout << "地址：" << pl << endl;
    srand(time(nullptr));

    pl->start();
    while(1)
    {
        int data = rand() % 100 + 1;
        pl->push(data);
        printf("push a data: %d\n", data);
        sleep(1);

        ThreadPool<int>* pl = ThreadPool<int>::create();
        //cout << "地址：" << pl << endl;
    }

    //sleep(3);
    return 0;
}